package com.hlw.hr_man.serviceImpl;

import java.util.List;

import com.hlw.hr_man.Model.Overtime;
import com.hlw.hr_man.dao.OverTimeDao;
import com.hlw.hr_man.daoImpl.OvertimeDaoImpl;
import com.hlw.hr_man.service.OvertimeService;

/**
 * 
 * @ClassName: OvertimeServiceImpl
 * @Description: 加班功能服务实现类
 * @author 唐明
 * @date 2016年9月12日 上午11:13:33
 *
 */
public class OvertimeServiceImpl implements OvertimeService {

	OverTimeDao otdao = new OvertimeDaoImpl();
	
	@Override
	public List<Overtime> getEmployeeOvertimeByEid(int eid) {
		// TODO Auto-generated method stub
		return otdao.selectEmployeeOvertimeByEid(eid);
	}

	@Override
	public List<Overtime> getEmployeeOvertimeByEid(int eid, int start, int pageSize) {
		// TODO Auto-generated method stub
		return otdao.selectEmployeeOvertimeByEid(eid, start, pageSize);
	}

	@Override
	public int getEmployeeOvertimeCount(int eid) {
		// TODO Auto-generated method stub
		return otdao.selectEmployeeOvertimeCount(eid);
	}

	@Override
	public List<Overtime> getEmployeeOvertimeBySearch(String searchType, String searchContent, int start,
			int pageSize) {
		// TODO Auto-generated method stub
		return otdao.selectEmployeeOvertimeBySearch(searchType, searchContent, start, pageSize);
	}

	@Override
	public int getEmployeeOvertimeCount(String searchType, String searchContent) {
		// TODO Auto-generated method stub
		return otdao.selectEmployeeOvertimeCount(searchType, searchContent);
	}

	@Override
	public boolean addOvertime(Overtime ot) {
		// TODO Auto-generated method stub
		if (otdao.insertOvertime(ot) == 1) {
			return true;
		} else {
			return false;
		}
	}

	@Override
	public boolean deleteOvertimeByEid(int e_id) {
		// TODO Auto-generated method stub
		if (otdao.deleteOvertimeByEid(e_id)>=0) {
			return true;
		} else {
			return false;
		}
	}

}
